package com.liang.exam.utils;

import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;


public class Md5Util {
    public static final String salt="z3g8r3h4bS8DFG0R";

    /**
     * MD5加盐加密
     * @param password
     * @return
     */
    public static String getMd5Encryption(String password){
        return DigestUtils.md5DigestAsHex((password+salt).getBytes(StandardCharsets.UTF_8));
    }

    public static void main(String[] args) {
        System.out.println(getMd5Encryption("123456"));
    }



}
